local bewater    = require "bw.bewater"
local http_agent = require "bw.server.http_agent"
local log        = require "bw.log"
local sname      = require "sname"
local Hall       = bewater.proxy(sname.HALL)

local M = {
    url = "/center/user/set_value",
    auth = true,
    data = {
        appname = "string?",
        key = "string",
        value = "string?",
    },
}

function M.handler(_, req, acc)
    local key = req.key
    if req.appname then
        key = req.appname.."_"..req.key
    end
    Hall.set_user_kv(acc, key, req.value)
end

http_agent.reg(M)
